argss <- commandArgs(trailingOnly = TRUE)

print(argss)

hom_bulk=argss[1]
het_single=argss[2]
hom_single=argss[3]

snp_hom_bulk=read.table(hom_bulk)
snp_het_single=read.table(het_single)
snp_hom_single=read.table(hom_single)

hom_het=length(intersect(snp_hom_bulk$V1, snp_het_single$V1))
hom_hom=length(intersect(snp_hom_bulk$V1, snp_hom_single$V1))

alpha=hom_het/(2*hom_hom+hom_het)

fpr=1-(1-alpha)^2

# print(adr)

write.table(c("FPR", fpr), file="1.fpr.txt", quote=F, row.names=F, col.names=F)